package server;
import io.grpc.stub.StreamObserver;
import nwpu.cn.grpc.api.*;
public class RPCAddServiceImpl extends RPCAddServiceGrpc.RPCAddServiceImplBase{
    @Override
    public void getAdd(RPCAddRequest request, StreamObserver<RPCAddResponse> responseObserver) {
        RPCAddResponse rpcAddResponse=null;
        String result=request.getFirst()+request.getSecond();
       try{
           rpcAddResponse=RPCAddResponse.newBuilder().setResult(result).build();
       }catch (Exception e){
           responseObserver.onError(e);
       }finally {
           responseObserver.onNext(rpcAddResponse);
       }
       responseObserver.onCompleted();
    }
}
